<template>
  <div>
    <b-map-component :om="giveOutData" v-if="flag"></b-map-component>
  </div>
</template>
<script>
  import BMapComponent from '../../components/common/BMap'
  import * as monitorSite from '../../api/monitorSite'
  export default {
    data() {
      return {
        giveOutData:{
          height:document.documentElement.clientHeight,
          longitude:116.417854,
          latitude:39.921988,
          data_info:{},
          zoom:6,
        },
        flag: false
      }
    },
    mounted  :function(){
      monitorSite.subIndexData(this.$route.params.parentId,(response)=>{
        this.giveOutData.data_info = response.children;
        this.giveOutData.latitude = response.info.locationy;
        this.giveOutData.longitude = response.info.locationx;
        this.giveOutData.zoom = 11;
        this.flag = true
      })
    },
    components:{
      'b-map-component':BMapComponent,
    }
  }
</script>
<style>

</style>
